package designmodule.iterator;

public class Main {
    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf(4);
        Book book1 = new Book("《Java从入门到放弃》");
        Book book2 = new Book("《Python从入门到放弃》");
        Book book3 = new Book("《Mysql从删库到跑路》");
        Book book4 = new Book("《机器学习入门》");
        bookShelf.appendBook(book1);
        bookShelf.appendBook(book2);
        bookShelf.appendBook(book3);
        bookShelf.appendBook(book4);
        MyIterator myIterator = bookShelf.myIterator();
        while (myIterator.hasNext()) {
            Book book = (Book) myIterator.next();
            System.out.println(book.getName());
        }
    }
}
